package util.io;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;


/**
 * Export content to a text file.
 * 
 * @author Team07
 */
public class FileExporter {

	/**
	 * Saves data from a given string to a file
	 * 
	 * @param fileName
	 *            the specified file
	 * @param textToWrite
	 *            string to be stored in the file
	 */
	public static void saveToFile(String fileName, String textToWrite) {
		FileWriter fw;
		try {
			fw = new FileWriter(fileName);
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(textToWrite);
			bw.close();
			fw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
